function FeedBack($,com) {
	return {
		init:function(){
			// 点击反馈
            $('.feed').on("click",function () {
				$('.feedback-mask').show();
				$('.feedback').show();
            });
            // 点击关闭反馈
			$('.main .feed-close').on("click",function () {
				$('.feedback-mask').hide();
				$('.feedback').hide();
			})
			function getVal(val){
				return $.trim(val);
			}
			$("#feedSubmit").on("click",function(){
				if($('input[type="radio"]:checked').val() == null){
					com.alertInfo("请选择反馈类别");
					return;
				}
				if(!getVal($("#username").val())){
					com.alertInfo("请输入您的姓名");
					return;
				}
				if(!getVal($("#email").val())){
					com.alertInfo("请输入您的电子邮箱");
					return;
                }
				var phone = getVal($('#telephone').val());
				if(phone && !(/^1\d{10}$/.test(phone))){
					alert("请输入正确的手机号码");
					return;
				}
                var feed_data = {};
                feed_data.feedtype = $('input[type="radio"]:checked').val();
                feed_data.model = $('#model').val();
                feed_data.email = $("#email").val();
                feed_data.username = $('#username').val();
                feed_data.phone = $('#telephone').val();
                feed_data.vol = $('#car_vol').val();
                feed_data.generation = $('#model_year').val();
                feed_data.remark = $('#reason').val();
				com.ajax({
					url:"/submitVinInfo.json",
					data: feed_data,
					success:function(res){
						if(res.success){
							com.alertInfo("反馈成功！",1);
							com.closeFeed();
                        }else{
							com.alertInfo(res.message);
                        }
					}
				});
            });
		}
	}
}
if("function"==typeof define && define.amd && define){
	define(['jquery','common/pccommons'],function($,com){
		return FeedBack($,com);
	});
}